<template>
	<view>
		<!-- <view id="nullL"></view> -->
		<view class="top-box">
			<u-navbar :is-back="false" height=50>
				<view class="title-box">
					<view class="three-title">
						<!-- <a href="#nullL"> -->
						<u-subsection :list="list1" :current="0" mode="subsection" active-color="#0079FE"
							@change="sectionChange"></u-subsection>
						<!-- </a> -->
					</view>
					<view v-if="curNow==0||curNow==1" class="screen" @click="show = true">
						<u-icon name="search" color="#0079FE"></u-icon>
						<span>筛选</span>
					</view>
				</view>
			</u-navbar>
			<view class="two-title-box">
				<view class="two-title">
					<view v-if="this.curNow==0||this.curNow==1" @click="changeTextFlagA"
						:class="[flagA==true?'title-color':'']">全选</view>
					<view v-if="this.curNow==2" @click="showCalendar = true">选择日期</view>
					<u-calendar v-model="showCalendar" :mode="mode" @change="changeCalendar"></u-calendar>
					<view v-if="this.curNow==0" @click="changeTextFlagB" :class="[flagB==true?'title-color':'']">批量领工
					</view>
					<view v-if="this.curNow==1" @click="changeTextFlagB" :class="[flagB==true?'title-color':'']">批量报工
					</view>
					<view v-if="this.curNow==2" @click="changeTextFlagB" :class="[flagB==true?'title-color':'']">工时查询
					</view>
				</view>
			</view>
		</view>
		<!-- <view v-if="curNow==0"><foreman></foreman></view>
		<view v-if="curNow==1"><reportWork></reportWork></view>
		<view v-if="curNow==2"><workTime></workTime></view> -->
		<!-- <button v-if="curNow==2" >打开</button> -->
		<u-popup v-model="showDetails" mode="top" border-radius="14" :closeable='true'>
			<scroll-view scroll-y="true" style="height: 1000rpx;">
				<view class="pop-up-main">
					<view class="details-top">查看详情-[{{this.workTrainNo}}] {{this.workTrainModel}}</view>
					<view class="details-bottom">
						<view class="details-left">
							<view class="details-left-title">物料</view>
							<view class="details-left-main">
								<u-collapse>
									<u-collapse-item :title="item.head" v-for="(item, index) in itemList" :key="index"
										:open="item.open" :disabled="item.disabled">
										{{item.body}}
									</u-collapse-item>
								</u-collapse>
							</view>
						</view>
						<view class="details-right">
							<view class="details-right-title">
								<u-icon name="clock"></u-icon><span>工时列表</span>
							</view>
							<view class="details-right-main">
								<u-table>
									<u-tr class="u-tr">
										<u-th class="u-th" width=12%>序号</u-th>
										<u-th class="u-th" width=60%>物料</u-th>
										<u-th class="u-th">姓名</u-th>
										<u-th class="u-th">工时</u-th>
									</u-tr>
									<u-tr class="u-tr" v-for="(item,index) in workDetailsList" :key="index">
										<u-td class="u-td" width=12%>{{index+1}}</u-td>
										<u-td class="u-td" width=60%>{{item.material.name}}</u-td>
										<u-td class="u-td">{{item.userName}}</u-td>
										<u-td class="u-td">{{item.assignWorkCycle}}</u-td>
									</u-tr>
								</u-table>
							</view>
						</view>
					</view>
				</view>
			</scroll-view>
		</u-popup>
		<view class="main">
			<template v-for="(item,index) in list ">
				<view class="big-content" :key="index">
					<view class="content-box">
						<view class="first" v-if="curNow==0||curNow==1">
							<!-- <view class="first-newline-a">{{item.carName}}</view> -->
							<view class="first-newline-b"><span>车号：</span><span>{{item.trainNo}}</span></view>
							<!-- <view class="first-newline-c"><span>车型：</span><span>{{item.carType}}</span></view> -->
							<view class="second-newline-a">
								<u-icon name="clock"></u-icon><span class="time">{{item.createTime}}</span>
							</view>
							<view class="third" v-if="curNow==0||curNow==1">
								<u-checkbox-group>
									<u-checkbox @change="checkboxChange(item)" v-model="item.checked" shape="circle">
									</u-checkbox>
									<!-- // -->
								</u-checkbox-group>
							</view>
						</view>
						<view class="first" v-if="curNow==2">
							<view class="first-newline-b"><span>车号：</span><span>{{item.trainNo}}</span></view>
							<view class="second-newline-a finish-time">
								<span>完成时间：</span><span class="time">{{item.stationEndTime}}</span>
							</view>
						</view>

						<view class=" finish-second" v-if="curNow==2">
							<!-- <view class="second-newline-b"><span>产线：</span><span>{{item.line.name}}</span></view> -->
							<view><span>车型：</span><span>{{item.trainModel.name}}</span></view>
							<view><span>工时：</span><span>{{item.myCycle}}</span></view>
						</view>
						<view class="second" v-if="curNow==2">
							<view class="second-newline-b"><span>产线：</span><span>{{item.line.name}}</span></view>
						</view>

						<view class="second" v-if="curNow==0||curNow==1">

							<view class="second-newline-b"><span>物料编码：</span><span>{{item.material.code}}</span></view>
							<view class="second-newline-c"><span>物料名称：</span><span>{{item.material.name}}</span></view>
							<!-- <view v-if="this.curNow==1">123</view> -->
						</view>

					</view>
					<!-- 工时列表下面的按钮 -->
					<view v-if="curNow==2" class="center" @click="showDetailsClick(item)">
						<u-icon name="checkbox-mark"></u-icon>
						<span>分配详情</span>
					</view>

					<view v-if="curNow==0||curNow==1" class="center" @click="receive(item,index)">
						<u-icon name="checkbox-mark"></u-icon>
						<!-- <span v-if="this.curNow==0">领工</span>
						<span v-if="this.curNow==1">报工</span>
						<span v-if="this.curNow==2">工时查询</span> -->
						<!-- <span >报工</span> -->
						<span>{{item.confirm}}</span>
					</view>
				</view>

			</template>
			<view v-if="this.allListItemA==true" class="ending">
				没有更多数据了
			</view>
			<view v-if="this.allListItemB==true" class="ending">
				没有更多数据了
			</view>
		</view>
		<view>
			<u-popup v-model="show" mode="right" :closeable="true" width="600">
				<h2>数据筛选</h2>
				<view>
					<view class="car-num">
						车号
					</view>
					<!-- <ul class="ul-list">
						<li v-for="(item,index) in numList" :key="index" @click="changeColor(index,item)" :class="[index==showIndexNum?'color-one':'']">
							{{item.num}}
						</li>
					</ul> -->
					<view class="input">
						<u-input v-model="valueNum" placeholder="输入车号" :type="type" :border="border"
							border-color="#ddd" />
					</view>
				</view>
				<view>
					<view class="state">
						状态
					</view>
					<ul v-if="this.curNow==0" class="ul-list">
						<li v-for="(item,index) in textList" :key="index" @click="changeC(index,item)"
							:class="[index==showIndexWork?'color-one':'']">
							{{item.text}}
						</li>
					</ul>
					<ul v-if="this.curNow==1" class="ul-list">
						<li v-for="(item,index) in textListA" :key="index" @click="changeC(index,item)"
							:class="[index==showIndexWork?'color-one':'']">
							{{item.text}}
						</li>
					</ul>
				</view>
				<view>
					<view class="code">
						物料编码
					</view>
					<view class="input">
						<u-input v-model="value" placeholder="输入物料编码" :type="type" :border="border"
							border-color="#ddd" />
					</view>
				</view>
				<view class="btn">
					<u-button type="primary" @click="deteSearch" :plain="true">确定</u-button>
				</view>
			</u-popup>

		</view>
	</view>

</template>

<script>
	// import foreman from "../../components/foreman.vue"
	// import reportWork from "../../components/reportWork.vue"
	// import workTime from "../../components/workTime.vue"
	import {
		PlanWorkReport
	} from "./api/index.js"
	export default {
		// components: {
		// 	foreman, //报工
		// 	reportWork, //领工
		// 	workTime, //查询
		// },
		data() {
			return {
				showDetails: false, //工时详情开关
				itemList: [{
						head: "所有部件",
						body: "底体架组装（3.1)", //底体架组装（3.1)
						open: true,
						disabled: false
					},


				],
				showCalendar: false, //日历开关
				mode: 'range', //日历的模式
				flagA: '', //全选默认不选
				flagB: '', //批量领工默认不选
				current: 0,
				checkValue: '', //存放选择球属性
				allCheck: false, //控制所有小球属性
				curNow: 0,
				// showText:null,//头部索引
				showIndexNum: 0, //弹出层第一部分的索引
				showIndexWork: 0, //弹出层第二部分的索引
				value: '', //搜索里 输入框的值物料编码
				valueNum: '', //搜索里 输入框车号
				type: 'text', //输入框的格式
				border: true, //输入框的边框
				workTrainNo: '', //存放工时车号
				workTrainModel: "", //存放工时车型
				addInfo: "", //拼接工时信息
				workDetailsList: [], //工时详情列表
				pageNumA: 0, //请求页数
				pageNumB: 0, //请求页数
				pageSize: 10, //请求个数
				code: '', //物料编码
				name: '', //物料名称
				textPre:"",//弹出层里面的选择的数据
				// listTitle:[{text:"全选"},{text:"批量领工"}],//头部分的数据
				idsA: [], //单击小球批量存放id
				textList: [{
						text: "未领工"
					},
					{
						text: "已领工"
					}
				], //弹出层文字选择
				textListA: [{
						text: "已领工"
					},
					{
						text: "已报工"
					}
				],
				numList: [{
						num: 4830501
					},
					{
						num: 6270071
					},
					{
						num: 4935208
					},
					{
						num: 4942165
					},
					{
						num: 4202123
					}
				], //弹出层的数字
				beginDate: "", //开始时间
				endDate: "", //结束时间
				//领工
				listFore: [

				], //圆选择
				list: [],
				//报工
				listReport: [

				], //圆选择
				//查询
				listTime: [

				], //圆选择
				totalA: '', //领工总数
				totalB: '', //报工总数
				allListItemA: false, //控制是否加载完成
				allListItemB: false, //控制是否加载完成
				show: false, //侧边弹出层
				keyWordsFirst: 4830501,
				keyWordsSecond: "未领工",
				list1: [{
						name: '领工'
					},
					{
						name: '报工'
					},
					{
						name: '工时查询'
					}
				],

			};

		},
		methods: {
			//下拉加载更多已领工数据
			getmoreclaimA() {
				console.log(1111);
				let params = {
					page: this.pageNumA,
					size: this.pageSize,
					materialUserStatus: "ASSIGNED", //UNASSIGN
					// productionState: "NOT_BEGIN",
					// showState: "0",
					// sort: "id,desc",
				}
				PlanWorkReport.listGet(params).then(res => {
					console.log(res);
					// this.totalA=res.data.totalElements
					res.data.content.forEach((item, index) => {
						item.createTime = item.createTime.substr(0, 16)
						this.$set(item, 'checked', false)
						this.$set(item, 'confirm', "领工")
						this.list.push(item)
					})
					console.log(this.list);
					// console.log(this.list);
					// this.listFore = res.data.content;
					// this.list = this.listFore
					// console.log(this.listReport);
					// console.log(res.data.content);
				})
			},
			//下拉加载更多已报工列表
			getmoreFinishA() {
				let params = {
					page: this.pageNumB,
					size: this.pageSize,
					materialUserStatus: "ASSIGNED",
					// productionState: "NOT_BEGIN",
					// showState: "0",
					// sort: "id,desc",
				}
				PlanWorkReport.listReport(params).then(res => {
					console.log(res);
					res.data.content.forEach((item, index) => {
						item.createTime = item.createTime.substr(0, 16)
						// console.log(item);
						this.$set(item, 'checked', false)
						this.$set(item, 'confirm', "报工")
						this.list.push(item)
					})
					// this.listReport = res.data.content;
					// this.list = this.listReport
					// this.listReport.push({checked:false})
					// console.log(this.listReport);
					// console.log(res.data.content);
				})
			},
			//已经领工列表
			claimList() {
				console.log("领工");
				let params = {
					page: 0,
					size: this.pageSize,
					materialUserStatus: "ASSIGNED", //UNASSIGN
					// productionState: "NOT_BEGIN",
					// showState: "0",
					// sort: "id,desc",
				}
				PlanWorkReport.listGet(params).then(res => {
					console.log(res);
					this.totalA = res.data.totalElements
					res.data.content.forEach((item, index) => {
						item.createTime = item.createTime.substr(0, 16)
						this.$set(item, 'checked', false)
						this.$set(item, 'confirm', "领工")
					})
					this.listFore = res.data.content;
					this.list = this.listFore
					// console.log(this.listReport);
					// console.log(res.data.content);
				})
			},
			//报工列表
			finishList() {
				let params = {
					page: 0,
					size: this.pageSize,
					materialUserStatus: "ASSIGNED",
					// productionState: "NOT_BEGIN",
					// showState: "0",
					// sort: "id,desc",
				}
				PlanWorkReport.listReport(params).then(res => {
					console.log(res);
					this.totalB = res.data.totalElements
					res.data.content.forEach((item, index) => {
						item.createTime = item.createTime.substr(0, 16)
						// console.log(item);
						this.$set(item, 'checked', false)
						this.$set(item, 'confirm', "报工")
					})
					this.listReport = res.data.content;
					this.list = this.listReport
					// this.listReport.push({checked:false})
					// console.log(this.listReport);
					// console.log(res.data.content);
				})
			},
			//工时查询列表
			workList() {
				let params = {
					page: 0,
					size: this.pageSize,
					beginDate: this.beginDate,
					endDate: this.endDate,
				}
				PlanWorkReport.workListGet(params).then(res => {
					console.log(res);
					// console.log(res.data.content);
					res.data.content.forEach((item, index) => {
						console.log(item);
						item.stationEndTime = item.stationEndTime.substr(0, 16)
						// this.$set(item, 'confirm', "分配详情")
					})
					this.list = res.data.content
					console.log(this.list);

				})
			},

			//工时列表下面的详情按钮
			showDetailsClick(e) {
				console.log(e);
				this.workTrainNo = e.trainNo
				this.workTrainModel = e.trainModel.name
				this.showDetails = true;
				let treeWord = {
					beginDate: this.beginDate,
					endDate: this.endDate,
					trainNo: e.trainNo
				};
				console.log(treeWord);
				PlanWorkReport.detailTree(treeWord).then(res => {
					console.log(res);
					res.data.forEach(item => {
						console.log(item.assignWorkCycle);
						this.addInfo = item.name + "(" + item.assignWorkCycle + ")"
					})
					//this.itemList.body
					// let addInfo= 
					// console.log(this.addInfo);
					this.itemList.forEach((item, index) => {
						console.log(this.addInfo);
						item.body = this.addInfo
						console.log(item.body);
					})
				})
				PlanWorkReport.detailList(treeWord).then(res => {
					console.log(res);
					this.workDetailsList = res.data
				})
			},


			//日历日期
			changeCalendar(e) {
				this.beginDate = e.startDate
				this.endDate = e.endDate
				console.log(this.beginDate);
				console.log(this.endDate);
			},

			receive(item, index) {
				// console.log(item);
				// console.log(index);
				if (this.curNow == 0) {
					uni.showModal({
						title: '提示',
						content: '确定要领工吗',
						success: function(res) {
							if (res.confirm) {
								PlanWorkReport.getWork({
									ids: [item.id]
								}).then(res => {
									console.log(res);
									this.list.splice(index, 1)
									uni.showToast({
										title: "领工成功",
										icon: "success"
									})
								}).catch(() => {
									uni.showToast({
										title: "存在工人代表已领工",
										icon: "error"
									})
								})
								console.log('用户点击确定');

							} else if (res.cancel) {
								// console.log('用户点击取消');
							}
						}.bind(this)
					});

					// console.log(item);
				}

				if (this.curNow == 1) {
					console.log(this.list);
					uni.showModal({
						title: '提示',
						content: '确定要报工吗',
						success: function(res) {
							if (res.confirm) {
								PlanWorkReport.reportWork({
									ids: [item.id]
								}).then(res => {
									this.list.splice(index, 1)
									console.log(res);
									uni.showToast({
										title: "报工成功",
										icon: "success"
									})
								}).catch(() => {
									uni.showToast({
										title: "存在工人已领工",
										icon: "error"
									})
								})
								console.log('用户点击确定');

							} else if (res.cancel) {
								// console.log('用户点击取消');
							}
						}.bind(this)
					});

					// console.log(item);
				}
			},
			checkboxChange(e) {
				console.log(e.id);
				console.log(e);


				// e.checked = !e.checked
				// 	console.log(e.checked);


				// 	this.checkValue = e.checked
				// 	console.log(this.checkValue);
				this.allCheck = this.list.every((item, index) => {
					item.checked == true
				})
				this.allCheck = this.list.every((item, index) => {
					item.checked == false
				})
			},
			changeTextFlagA() {
				this.flagA = true
				this.flagB = false
				console.log(111);
				if (this.allCheck == true) {
					this.list.forEach((item, index) => {
						item.checked = false
						console.log(2);
					})
					this.allCheck = false
				} else {
					this.list.forEach((item, index) => {
						item.checked = true
					})
					this.allCheck = true
				}

			},
			changeTextFlagB() {
				this.flagA = false
				this.flagB = true
				if (this.curNow == 0) {
					if (this.allCheck != true) {
						let flag = true
						let ids = [];
						this.list.forEach((item, index) => {
							// console.log(item);
							if (item.checked == true) {
								flag = false
								ids.push(item.id)
								// console.log(newArrIds);
							}
						})
						if (flag == true) {
							uni.showToast({
								title: "请勾选小球",
								icon: "error"
							})
						} else {
							PlanWorkReport.getWork({
								ids
							}).then(res => {
								let newArrFirst = [];
								this.list.forEach((item, index) => {
									if (item.checked == false) {
										newArrFirst.push(item)
									}
								})
								this.list = newArrFirst
								// this.checkValue = false
								uni.showToast({
									title: "操作成功",
									icon: "success"
								})
							}).catch(() => {
								uni.showToast({
									title: "存在工人代表已领工",
									icon: "error"
								})
							})

						}

						console.log(ids);
					} else {
						let idsA = []
						this.list.forEach((item, index) => {
							idsA.push(item.id)
						})
						PlanWorkReport.getWork({
							idsA
						}).then(res => {
							uni.showToast({
								title: "操作成功",
								icon: "success",
							})
							this.list = []
						}).catch(() => {
							uni.showToast({
								title: "存在工人代表已领工",
								icon: "error"
							})
						})

					}
				}

				if (this.curNow == 1) {
					if (this.allCheck != true) {
						let flag = true
						let ids = [];
						this.list.forEach((item, index) => {
							// console.log(item);
							if (item.checked == true) {
								flag = false
								ids.push(item.id)
								// console.log(newArrIds);
							}
						})
						if (flag == true) {
							uni.showToast({
								title: "请勾选小球",
								icon: "error"
							})
						} else {
							PlanWorkReport.reportWork({
								ids
							}).then(res => {
								let newArrFirst = [];
								this.list.forEach((item, index) => {
									if (item.checked == false) {
										newArrFirst.push(item)
									}
								})
								this.list = newArrFirst
								// this.checkValue = false
								uni.showToast({
									title: "操作成功",
									icon: "success"
								})
							}).catch(() => {
								uni.showToast({
									title: "存在工人代表已报工",
									icon: "error"
								})
							})

						}

						console.log(ids);
					} else {
						let idsA = []
						this.list.forEach((item, index) => {
							idsA.push(item.id)
						})
						PlanWorkReport.reportWork({
							idsA
						}).then(res => {
							uni.showToast({
								title: "操作成功",
								icon: "success",
							})
							this.list = []
						}).catch(() => {
							uni.showToast({
								title: "存在工人代表已报工",
								icon: "error"
							})
						})

					}
				}
				//工时
				if (this.curNow == 2) {
					console.log(111);
					this.workList();
				}

			},


			sectionChange(index) {
				// console.log(index);
				this.curNow = index
				console.log(index);
				if (index == 0) {
					this.claimList()
					this.list = this.listFore
					// this.list=this.listReport
					this.allListItemB = false //点第一个让第二个不显示


				}
				if (index == 1) {
					this.finishList();
					this.list = this.listReport
					console.log(this.list);
					this.allListItemA = false //点第二个让第一个不显示

				}
				if (index == 2) {
					this.list = this.listTime
					// this.list=this.listReport
					this.allListItemA = false
					this.allListItemB = false
					console.log(this.list);
				}
			},

			//弹出层第一部分的颜色改变
			// changeColor(index,item) {
			// 	this.showIndexNum=index
			// 	console.log(item.num);
			// 	this.keyWordsFirst=item.num
			// },//弹出层第二部分的颜色改变
			changeC(index, item) {
				this.showIndexWork = index
				// console.log(item.text);
				this.textPre=item.text
				console.log(this.textPre);
				this.keyWordsSecond = item.num
			},
			//头部颜色改变
			// changeTextColor(index) {
			// 	this.showText=index
			// },
			//弹出框的确认按钮
			deteSearch() {
				//请已领工的列表
			if(this.curNow==0) {
				if(this.textPre==""){
					uni.showToast({
						title:"请选择状态",
						icon:"error"
					})
				}else {
					this.show = false
					if(this.textPre=="已领工"){
								let params = {
									size: 1000,
									materialUserStatus: "ASSIGNED", //UNASSIGN
									trainNo:this.valueNum,
									materialCode:this.value,
									// productionState: "NOT_BEGIN",
									// showState: "0",
									// sort: "id,desc",
								}
								PlanWorkReport.listGet(params).then(res => {
									console.log(res);
									// this.totalA = res.data.totalElements
									res.data.content.forEach((item, index) => {
										item.createTime = item.createTime.substr(0, 16)
										this.$set(item, 'checked', false)
										this.$set(item, 'confirm', "领工")
									})
									this.listFore = res.data.content;
									this.list = this.listFore
									})
							}
					if(this.textPre=="未领工"){
						let params = {
							size: 1000,
							materialUserStatus: "UNASSIGN", //UNASSIGN
							trainNo:this.valueNum,
							materialCode:this.value,
							// productionState: "NOT_BEGIN",
							// showState: "0",
							// sort: "id,desc",
						}
						PlanWorkReport.listGet(params).then(res => {
							console.log(res);
							// this.totalA = res.data.totalElements
							res.data.content.forEach((item, index) => {
								item.createTime = item.createTime.substr(0, 16)
								this.$set(item, 'checked', false)
								this.$set(item, 'confirm', "领工")
							})
							this.listFore = res.data.content;
							this.list = this.listFore
							})
					}
				}
							
			}
			if(this.curNow==1) {
				if(this.textPre==""){
					uni.showToast({
						title:"请选择状态",
						icon:"error"
					})
				}else if(this.textPre=="已领工"){
					this.show = false
					let params = {
						size: 1000,
						materialUserStatus: "ASSIGNED",
						trainNo:this.valueNum,
						materialCode:this.value
						// productionState: "NOT_BEGIN",
						// showState: "0",
						// sort: "id,desc",
					}
					PlanWorkReport.listReport(params).then(res => {
						console.log(res);
						// this.totalB = res.data.totalElements
						res.data.content.forEach((item, index) => {
							item.createTime = item.createTime.substr(0, 16)
							// console.log(item);
							this.$set(item, 'checked', false)
							this.$set(item, 'confirm', "报工")
						})
						this.listReport = res.data.content;
						this.list = this.listReport
						// this.listReport.push({checked:false})
						// console.log(this.listReport);
						// console.log(res.data.content);
					})
				} else if(this.textPre=="已报工") {
					this.show=false
					let params = {
						size: 1000,
						materialUserStatus: "FINISHED",
						trainNo:this.valueNum,
						materialCode:this.value
						// productionState: "NOT_BEGIN",
						// showState: "0",
						// sort: "id,desc",
					}
					PlanWorkReport.listReport(params).then(res=>{
						console.log(res);
						res.data.content.forEach((item,index)=>{
							item.createTime = item.createTime.substr(0, 16)
							// console.log(item);
							this.$set(item, 'checked', false)
							this.$set(item, 'confirm', "报工")
						})
						this.listReport = res.data.content;
						this.list = this.listReport
					})
				}
			}
			},
			
			
			
			
		},
		onReachBottom() {
			if (this.curNow == 0) {
				console.log("这是第一页");
				var allTotal = (this.pageNumA + 1) * this.pageSize
				console.log(allTotal);
				console.log(this.totalA);
				// console.log(this.getmoreclaimA());
				if (allTotal < this.totalA) {
					this.allListItemA = false;
					this.pageNumA++;
					// console.log(this.pageNum);
					this.getmoreclaimA()
					console.log(this.list);
				} else {
					this.allListItemA = true;
					console.log('已加载全部数据')
				}
			}
			if (this.curNow == 1) {
				console.log("这是第二页");
				var allTotal = (this.pageNumB + 1) * this.pageSize
				console.log(allTotal);
				console.log(this.totalB);
				// console.log(this.getmoreclaimA());
				if (allTotal < this.totalB) {
					this.allListItemB = false;
					this.pageNumB++;
					// console.log(this.pageNum);
					this.getmoreFinishA()
					console.log(this.list);
				} else {
					this.allListItemB = true;
					console.log('已加载全部数据')
				}
			}
			if (this.curNow == 2) {

				console.log("这是第三页");
			}
		},
		created() {
			const date = new Date()
			// console.log(date.getFullYear());
			// console.log(date.getMonth());
			// console.log(date.getDate());
			// let yOne =data.getFullYear()

			// let beginTime = 
			// console.log(PlanWorkReport);
			//报工
			this.claimList();
			this.list = this.listFore

			// console.log(this.curNow);
			// console.log(111);
			//领工

			//工时查询
			// this.workList()

		}
	}
</script>

<style lang="scss" scoped>
	.top-box {
		// height: 180rpx;
		background-color: #fff;
	}

	.title-box {
		width: 600rpx;
		// margin: auto;
		margin-left: 128rpx;
		// margin-top: 8rpx;
	}

	.screen {
		margin-top: -54rpx;
		margin-left: 504rpx;
		float: left;
		width: 100rpx;
		// height: 80rpx;
		font-size: 32rpx;

		span {
			// font-size: 12px;
			color: #0079FE;
		}
	}

	/deep/ .u-item-bg {
		// width: 50px !important;
	}

	/deep/ .u-subsection {
		width: 80%;

	}

	.two-title-box {
		// width: 100%;
		// height: 160rpx;
		padding-top: 40rpx;
		background-color: #efefef;
		line-height: 160rpx;
		// margin-bottom: 10rpx;
		// padding-bottom: 10rpx;
	}

	.two-title {
		// margin-top: 10px;

		// width: 100%;
		// height: 80rpx;
		// padding-bottom: 10rpx;
		display: flex;
		justify-content: space-around;
		line-height: 40px;
		background-color: #fff;

	}

	//工时弹出层详情
	.pop-up-main {
		padding: 28rpx 20rpx;
		font-size: 30rpx;
	}

	.details-top {
		font-size: 30rpx;
		font-weight: bold;
	}

	.details-bottom {
		// padding: 10rpx 20rpx;
		// display: flex;
		// justify-content: space-around;
	}

	.details-left-title {
		margin-top: 10rpx;
	}

	.details-left-main {
		width: 400rpx;
	}

	/deep/.u-collapse-head {
		margin-left: 20rpx;
	}

	/deep/ .u-collapse-body {
		margin-left: 36rpx;
	}

	.details-right-title {
		margin-left: 10rpx;
		margin-top: 20rpx;
		margin-bottom: 20rpx;
	}



	.main {
		// margin-top: 10rpx;
		// margin-top: 32rpx;
		// padding-top: 40rpx;
		padding: 0rpx 20rpx;

		// width: 100%;
		// height: calc(100vh - 320rpx);
		height: calc(100vh - 300rpx);
		// height: 1000px;
		overflow: scroll;
		background-color: #efefef;

	}


	.content-box {
		// width: 96%;
		// height: 100px;
		// margin: auto;
		// padding: 6rpx 10rpx ;
		// height: 200rpx;
		padding: 10rpx 0rpx;
		padding-left: 30rpx;
		// display: flex;
		// justify-content: space-between;
		font-size: 30rpx;
		color: #999999;

	}

	.big-content:nth-of-type(1) {
		margin-top: 40rpx;
	}

	.big-content {
		// width: 100%;
		// height: 280rpx;
		border: 1px solid #fff;
		background-color: #fff;
		border-radius: 5px;
		margin-bottom: 20rpx;
	}

	// .first,
	// .second {
	// 	padding-top: 20rpx;
	// }
	.second {
		padding-left: 10rpx;
	}

	.third {
		padding-top: 16rpx;
		margin-left: -40rpx;
	}

	.first {
		display: flex;
		justify-content: space-between;
	}

	.first>view:nth-of-type(2),
	.second>view:nth-of-type(2) {
		padding: 20rpx 0rpx;
	}

	.first-newline-a {
		width: 258rpx;
	}

	.first-newline-b {
		padding-top: 20rpx;
		margin-left: 8rpx;
		// width: 258rpx;
	}

	.first-newline-c {
		width: 258rpx;
	}

	.finish-time {
		margin-right: 16rpx;
		padding-top: 18rpx !important;
	}

	.finish-second {
		padding: 0rpx 110rpx 24rpx 10rpx;
		display: flex;
		justify-content: space-between;
	}

	// .second-newline-a {
	// 	width: 320rpx;
	// }
	// .second-newline-b {
	// 	width: 340rpx;
	// }
	// .second-newline-c {
	// 	width: 340rpx;
	// }

	.center {
		border-top: 1px solid;
		border-color: rgba(242, 242, 242, 1);
		// width: 60%;
		// margin: auto;
		text-align: center;
		line-height: 40px;
		color: #0079FE;
		font-size: 32rpx;
	}


	h2 {
		color: #666666;
		width: 600px;
		height: 50px;
		text-align: left;
		line-height: 50px;
		border-bottom: 1px solid;
		border-color: rgba(242, 242, 242, 1);
		margin-left: 10px;
	}

	.car-num,
	.state,
	.code {
		margin: 16rpx 0px;
		font-size: 32rpx;
		color: #999999;
		margin-left: 24rpx;
	}

	.code {
		margin-bottom: 36rpx;
	}

	.ul-list {
		overflow: hidden;
	}

	.ul-list>li {
		float: left;
		margin-left: 20rpx;
		margin-top: 20rpx;
		width: 160rpx;
		height: 60rpx;
		text-align: center;
		line-height: 60rpx;
		border: 1px solid;
		border-color: rgba(242, 242, 242, 1);
		color: #999999;
		font-size: 32rpx;
	}

	.input {
		width: 510rpx;
		height: 60rpx;
		margin-left: 20rpx;
		// border: 1px solid #ddd;
	}

	.btn {
		margin-top: 40rpx;
		padding: 20rpx;
	}

	.color-one {
		border-color: rgba(82, 193, 245, 1) !important;
		background-color: rgba(248, 251, 255, 1) !important;
		color: rgb(82, 193, 245) !important;
	}

	.title-color {
		color: rgb(52, 120, 247)
	}

	.center>span {
		margin-left: 10rpx;
	}

	.time {
		margin-left: 10rpx;
	}

	.ending {
		font-size: 34rpx;
		text-align: center;
		color: #dedede;
	}
</style>
